package com.competition.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.competition.dao.FarmerDao;
import com.competition.entity.Farmer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FarmerMapper extends BaseMapper<Farmer> {

    @Select("SELECT farmer.`farmer_count`,user.`user_name`,user.`user_avatar` FROM USER,farmer WHERE user.user_id = farmer.`user_id`")
    List<FarmerDao> getAllByFarmer();
}
